package shujia.day10;

import java.util.LinkedList;

public class MyStack {
    private LinkedList list;
    public MyStack(){
        list = new LinkedList();
    }

    public void shuJiaAddElement(Object o){
        list.addFirst(o);
    }

    public Object shuJiaGetElement(){
        return list.removeFirst();
    }

    public int getSize(){
        return list.size();
    }

    @Override
    public String toString() {
        return "MyStack{" +
                "list=" + list +
                '}';
    }
}
